package com.feri.rbacsys.controller;

import com.feri.rbacsys.entity.Returnorder;
import com.feri.rbacsys.service.ReturnorderService;
import com.feri.rbacsys.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/returnorder/")
@Api(tags = "退货操作")
public class ReturnorderController {
    @Resource
    private ReturnorderService service;

    @PostMapping("addorder")
    @ApiOperation("添加退货单")
    public R addOrder(@RequestBody Returnorder returnorder) {
        return service.addOrder(returnorder);
    }

    @PostMapping("delorder")
    @ApiOperation("删除退货单")
    public R delOrder(int id) {
        return service.delOrder(id);
    }

    @GetMapping("allorder")
    @ApiOperation("查询所有订单")
    public R allOrder(int page, int size) {
        return service.allOrder(page, size);
    }

    @PostMapping("audito")
    @ApiOperation("审核退货单")
    public R audito(int id) {
        return service.audito(id);
    }
}
